package online.hxstar.cloud.web.config;

import lombok.extern.slf4j.Slf4j;
import online.hxstar.cloud.web.util.EntityUtil;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author xinghu
 * @date 2019/9/6 3:33 下午
 */
@Slf4j

public class RequestInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException {
        log.info(request.getRequestURL().toString());
        log.info(EntityUtil.ReadAsChars(request));
        return true;
    }
}
